//
//  MLAShopDetailInfoVC.m
//  MagicLampApp
//
//  Created by Zheng on 2019/2/28.
//  Copyright © 2019 zheng.magic.lamp.app. All rights reserved.
//

#import "MLAShopDetailInfoVC.h"
#import "MLAStoreHomeModel.h"

@interface MLAShopDetailInfoVC ()

@end

@implementation MLAShopDetailInfoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configTitle:@"商铺信息"];
    
    self.showAccessoryView = YES;
    

    [MLAHttpManage postHostType:MLAHttpHostType_Diancan api:kShopDetails params:nil success:^(id  _Nonnull response, NSString * _Nonnull msg) {
        NSArray *list = response[@"lists"];
        if (list.count == 1) {
            NSDictionary *dic = list[0];
            MLAStoreHomeModel *model = [MLAStoreHomeModel mj_objectWithKeyValues:dic];
            [self configSubviewWithModel:model];
        }
    } failure:^{
        
    }];
}


- (void)configSubviewWithModel:(MLAStoreHomeModel *)model {
    
    UIView *footerView = [[UIView alloc] init];
    footerView.frame = CGRectMake(0, 0, CX_GetScreenWidth(), 80);
    
    UILabel *titleLbl = [[UILabel alloc] init];
    titleLbl.frame = CGRectMake(15, 10, 80, 30);
    titleLbl.text = @"营业执照：";
    titleLbl.font = CX_GetNormalFont(12);
    [footerView addSubview:titleLbl];
    
    UIImageView *imgv = [[UIImageView alloc] init];
    imgv.frame = CGRectMake(80, 12, 150, 90);
    [imgv sd_setImageWithURL:[NSURL URLWithString:model.business_license]];
    [footerView addSubview:imgv];
    
    self.tableView.tableFooterView = footerView;
    
    self.titlesArr = @[[NSString stringWithFormat:@"店铺名称：%@",model.shop_name],
                       [NSString stringWithFormat:@"门店分类：%@",model.shop_type_name],
                       [NSString stringWithFormat:@"人均消费：%@",model.person_average],
                       [NSString stringWithFormat:@"商铺位置：%@%@%@",model.province,model.city,model.area],
                       [NSString stringWithFormat:@"详细地址：%@",model.address],
                       [NSString stringWithFormat:@"店铺介绍：%@",model.content]];
    [self.tableView reloadData];
    
    
    
}

@end
